<?php
include 'includes/inc_header_list.php';
include 'includes/inc_header.php';
include 'includes/inc_menu.php';
?>
<div id='cols' class='box'><?php include 'includes/left-column.php' ?></div>
<div id='content' class='box'>
    <h1>Usuários</h1>
    <p id='btn-create' class='box'>
        <a href='usuario_cad.php' title="Cadastra novo usuário"><span>Adicionar Usuário</span></a>
    </p>
    <div class='fix'></div>
    <table width="100%" class='tablesorter' id='listagem'>
        <thead>
            <tr>
                <th class='t-center scope='col'>Nome</th>
                <th class='t-center scope='col'>Usuário</th>
                <th class='t-center scope='col'>Email</th>
                <th class='t-center scope='col' colspan="2">Ações</th>
            </tr>
        </thead>
        <tfoot>
        </tfoot>
        <?php
           require_once 'Model/DAO/UsuarioDAO.php';
           $usuarioDAO = new UsuarioDAO();
           foreach ($usuarioDAO->getAllUsuario() as $linhas):
         ?>
        <tbody id='lista'>
            <tr>
                <td><?= utf8_encode($linhas['nome'])?></td>
                <td class='t-center'><?=utf8_encode($linhas['usuario'])?></td>
                <td class='t-center'><?=$linhas['email']?></td>
                <td class='t-center'>
                    <a href='usuario_edit.php?IDUsuario=<?=$linhas['IDUsuario'];?>'>
                        <img src='img/design/ico-edit.gif' class='ico' alt='Edita registro' />
                    </a>
                    <a href='usuario_del.php?IDUsuario=<?=$linhas['IDUsuario'];?>'>
                        <img src='img/design/ico-delete.gif' class='ico' alt='Deleta regsitro' />
                    </a>
                </td>
            </tr>
        </tbody>
        <?php endforeach; ?>
        </table>
    </div>  
<?php include 'includes/inc_footer.php'; ?>